package club.janna.concurrency.example.wait;

/**
 * @Auther: guopanbo
 * @Date: 2018/7/30 22:24
 * @Description:
 */
public class TestWait implements Runnable{



    private void test() {
        synchronized(TestWait.class) {
            System.out.println(1);
            System.out.println("开始等待");
            try {
                TestWait.class.wait(30 * 1000);
            } catch (InterruptedException e) {
                System.out.println("超时");
                e.printStackTrace();
            }
            System.out.println("TestWait 完成");
        }
    }

    @Override
    public void run() {
        test();
    }
}
